
public class Statement {
	Block b;
	LocalVarDecl lvd;
	AssignStmt as;
	IfStmt is;
	WhileStmt ws;
	ReturnStmt rs;
	
	public Statement  ( Block b, LocalVarDecl lvd, AssignStmt as, IfStmt is, WhileStmt ws, ReturnStmt rs){
		this.b = b;
		this.lvd = lvd;
		this.as = as;
		this.is = is;
		this.ws = ws;
		this.rs = rs;
	}
	public String toString(){
		String ret = "";

		String s = "";
		if (b != null) {
			s +=  b.toString();
		}
		if (lvd != null) {
			s += lvd.toString();
		}
		if (as != null) {
			s +=  as.toString();
		}
		if (is != null) {
			s +=  is.toString();
		}
		if (ws != null) {
			s +=  ws.toString();
		}
		if (rs != null) {
			s += rs.toString();
		}

		
		return ret + s ;
	}
	public void check() throws SemanticException {
		// TODO: complete
		if (lvd != null) {
			lvd.check();
		}
		if (b != null) {
			b.check();
		}
		if (is != null) {
			is.check();
		}
		if (ws != null) {
			ws.check();
		}
		if (rs != null) {
			rs.check();	
		}
		if (as != null) {
			as.check();
		}
	}
}
